<%@ Register TagPrefix="cc2" Namespace="PHSRAG.Insight21.InsightWebControls" Assembly="PHSRAG.Insight21.InsightWebControls" %>
<%@ Register TagPrefix="cc1" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>

<%@ Page Language="c#" Inherits="PHSRAG.Insight21.PayrollReport" CodeFile="PayrollReport.aspx.cs" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Payroll Report</title>
    <link href="../Insight21.css" type="text/css" rel="stylesheet" />

    <script type="text/javascript" src="../Scripts/SQLReport.js"></script>

    <script type="text/javascript" language="javascript">
		//Get child nodes with the specified name
		function GetByTagName(node, name){ 
			var childArray = new Array(); 
			for(var i=0; i<node.childNodes.length; i++)
			{ 
				if(node.childNodes[i].nodeName == name)
				{ 
					childArray[childArray.length] = node.childNodes[i]; 
				} 
			} 
			return childArray; 
		} 
		
		function OnDownloadPayrollReport(rptName, pageUrl){
			var hiddenSearchCriteria = document.getElementById('hiddenSearchCriteria');
			
			
			var reportDate;
			var reportDates = document.getElementsByTagName('Select');
			if (reportDates.length > 0)
			{
				var options = GetByTagName(reportDates[0], 'OPTION');
				for(var k=0; k<options.length; ++k)
				{
					if (options[k].selected)
					{
						reportDate = options[k].value;
						break;
					}
				}
			}
			hiddenSearchCriteria.value = reportDate;
			
			return GetReport(rptName, 'PDF', pageUrl, 'Reports/SqlReportHost.aspx');
		}
    </script>

</head>
<body>
    <form id="PayrollReportForm" method="post" runat="server">
        <table class="Container">
            <tr>
                <td>
                    <table class="Header" width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <cc2:Header ID="insightHeader" runat="server"></cc2:Header>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc2:PersonnelSubNavigation ID="personnelSubNavigation" runat="server"></cc2:PersonnelSubNavigation>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:BreadCrumb ID="payrollBreadCrumb" runat="server" />
                            </td>
                        </tr>
                    </table>
                    <table class="Invisible" id="dynamicTable" cellspacing="10">
                        <tr>
                            <td>
                                <cc1:ActivityIndicator ID="activityIndicator" ContainerID="dynamicTable" runat="server">
                                </cc1:ActivityIndicator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:Annunciator ID="annunciator" ContainerID="dynamicTable" runat="server"></cc1:Annunciator>
                            </td>
                        </tr>
                    </table>
                    <table class="Invisible">
                        <tr>
                            <td align="right">
                                <cc2:InsightDownloadBar ID="reportDownload" runat="server" />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <input id="hiddenSearchCriteria" runat="server" type="hidden" />
                    <table>
                        <tr>
                            <td style="width:3%">
                                &nbsp;</td>
                            <td style="width:57%">
                                The payroll report identifies all of the planned changes for salary and payroll
                                distributions for the next three months. To generate the changes that are required
                                to be entered within PeopleSoft Manager Self-Service, please select the payroll
                                date from the drop down and press the 'download' button. A PDF report will then
                                appear with the changes required listed. For more information, please refer to the
                                Insight help menu in the top right corner or user manual available from the Home
                                Page.
                            </td>
                            <td style="width:40%">
                                &nbsp;</td>
                        </tr>
                    </table>
                    <table cellspacing="10">
                        <tr>
                            <td>
                                <b>Payroll Report Date:&nbsp;</b>
                                <asp:DropDownList ID="reportDates" runat="server" Width="200px">
                                </asp:DropDownList>&nbsp;
                                <asp:ImageButton ImageAlign="AbsBottom" ID="downloadPayrollReport" ImageUrl="../Images/b_download.gif"
                                    runat="server"></asp:ImageButton>
                            </td>
                        </tr>
                    </table>
                    <br />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
